<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="mainMenu" />
<meta name="nav" content="0" />
<meta name="acc" content="0" />
<title>用户部门</title>
</head>
<body>
	<form action="user_department.action" method="post" class="yform"
		id="mainForm">
		<div>
			<table>
				<tr>
					<th>姓名</th>
					<th>部门名称</th>
					<th>职务</th>
					<th>开始日期</th>
					<th>结束日期</th>
					<th>操作</th>
				</tr>
				<c:forEach items="${userDepartments }" var="userDepartment">
					<tr>
						<td>${userDepartment.user.name }</td>
						<td>${userDepartment.department.depName }</td>
						<td>${userDepartment.officalPosition }</td>
						<td>${userDepartment.startDate }</td>
						<td>${userDepartment.endDate }</td>
						<td><security:authorize ifAnyGranted="ROLE_修改角色">
								<a href="user_department!input.action?id=${userDepartment.id }">修改</a>
								<a href="user_department!delete.action?id=${userDepartment.id }">删除</a>
							</security:authorize></td>
					</tr>
				</c:forEach>
			</table>
		</div>

		<div id="pagebar">
			第${page.pageNo}页, 共${page.totalPages}页 <a
				href="javascript:jumpPage(1)">首页</a>
			<s:if test="page.hasPre">
				<a href="javascript:jumpPage(${page.prePage})">上一页</a>
			</s:if>
			<s:if test="page.hasNext">
				<a href="javascript:jumpPage(${page.nextPage})">下一页</a>
			</s:if>
			<a href="javascript:jumpPage(${page.totalPages})">末页</a>

			<security:authorize ifAnyGranted="ROLE_修改用户">
				<a href="user_department!input.action">添加用户到部门</a>
			</security:authorize>
		</div>
	</form>
</body>
</html>